#include <iostream>
using namespace std;
class Parent {
    public:
        virtual void vir_function1() {
            cout << "Parent vir_function1" << endl;
        }
        virtual void vir_function2() {
            cout << "Parent vir_function2" << endl;
        }
    private:
        int a;
        int b;    
};

class Child:public Parent {
    public: 
        virtual void vir_function1() {
            cout << "Child vir_function1" << endl;
        }
        virtual void vir_function2() {
            cout << "Child vir_function2" << endl;
        }
    private:
        int c;    
};

int main(int argc, char const *argv[])
{
    Child child;
    // 父类指针指向子类对象
    Parent *parent = &child;
    parent->vir_function1();
    parent->vir_function2();
    
    return 0;
}
